package arrays;
import java.util.Scanner;
public class Calculate {

	
	public static void main(String[] args) {
		Scanner input;
		input= new Scanner(System.in);
		String str;
		int fno;
		int sno;
		int sum,diff,prod;
		double quo;
        Calculator c=new Calculator();
        System.out.println("Type 'add,'subtract','multiply' or 'divide'");
        str = input.nextLine();
 
if (str.equalsIgnoreCase("add"))
{   
	System.out.println("Enter the first no");
    fno=input.nextInt();
    System.out.println("Enter the second no");
    sno=input.nextInt();
	sum=c.addmthd(fno, sno);
    System.out.println(fno+" + "+sno+" = "+sum);

	}
if (str.equalsIgnoreCase("subtract"))
{
	System.out.println("Enter the first no");
    fno=input.nextInt();
    System.out.println("Enter the second no");
    sno=input.nextInt();
    diff=c.subtractMthd(fno,sno);
    System.out.println(fno+" - "+sno+" = "+ diff);

}
if (str.equalsIgnoreCase("multiply"))
{
	System.out.println("Enter the first no");
    fno=input.nextInt();
    System.out.println("Enter the second no");
    sno=input.nextInt();
    prod=c.multiplyMthd(fno,sno);
    System.out.println( fno+" * "+sno+" = "+prod);
}
if (str.equalsIgnoreCase("divide"))
{   System.out.println("Enter the first no");
    fno=input.nextInt();
    System.out.println("Enter the second no");
    sno=input.nextInt();
    quo=c.divideMthd(fno,sno);
    System.out.println(fno+" / "+sno+" = "+ quo);
}

}
}
